<?php

/**
 * 优惠密码生成信息
 * @author Ice <iceinto@mallog.com.cn>
 */
class LimitedCodeAction extends LoginAction {
	public function index(){
		$this->display();
	}
	public function add(){
		if(isPost()){
			$mid = intval(getPost('mid'));
			$count = intval(getPost('count'));
			
			$data = array();
			$LimitedCodeModel = D('LimitedCode');
			import("@.ORG.Util.String");
			$i = 0;
			for(;$i < $count;$i++){
				$verify = String::rand_string(6, 2, '0123456789');
				$data['mid'] = $mid;
				$data['code'] = $verify;
				$data['type'] = 2;
				$data = $LimitedCodeModel->create($data);
			}
		}
		$malls = M('Market')->field('m_id,m_name')->select();
		$this->assign('malls', $malls);
		$this->display();
	}
	
	public function edit(){

		$this->display();
	}
}

?>
